<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>图书-作者案例</title>
</head>
<body>
<form action="/create" method="post">
    {{ form.csrf_token }}
    {{ form.author_name.label }}{{ form.author_name }}<br>
    {{ form.book_title.label }}{{ form.book_title }}<br>
    {{ form.submit }}<br>
    {% for msg in get_flashed_messages() %}
    {{ msg }}<br>
    {% endfor %}
</form>
<ul>
    {% for author in authors %}
        <li>{{ author.name }}</li>
        <ul>
        {% for book in author.books %}
            <li>{{ book.title }}--<a href='/delete/{{ book.id }}'>删除</a></li>
        {% endfor %}
        </ul>
    {% endfor %}
</ul>
</body>
</html>